package com.bookmall.cart.feign;

import com.bookmall.cart.domain.vo.MemberAddressVo;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Description:
 * @Author 胡菜鸡
 * @Create 2022-04-21-17:35
 */
@FeignClient("bookmall-member")
public interface MemberFeignService {
    @GetMapping("/member/address/address/{memberId}")
    public List<MemberAddressVo> getAddress(@PathVariable("memberId") String memberId);

    @PostMapping("/member/address")
    public AjaxResult add(@RequestBody MemberAddressVo memberReceiveAddress);

    /**
     * 获取用户收货地址详细信息
     */
    @PreAuthorize("@ss.hasPermi('member:address:query')")
    @GetMapping(value = "/member/address/{id}")
    public AjaxResult getAddressInfo(@PathVariable("id") String id);
}
